<template>
  <div>
    <nav-bar :title="list[typeId]"></nav-bar>
    <van-cell-group>
      <van-cell v-for="(item) in message" :title="item.message" is-link
                @click="$router.push(route[typeId] + item.itemId)"/>
    </van-cell-group>
  </div>
</template>

<script>
import NavBar from "components/NavBar/NavBar";

export default {
  name: "NotificationDetailed",
  data() {
    return {
      menu: '',
      typeId: 0,
      list: ['未读评论', '点赞', '关注', '系统消息'],
      activityId: 0,
      commentId: 0,
      route: ['/index/explore/detailed?id=', '/index/explore/detailed?id=', '/index/explore/circledetailed?id=', ''],
      message: []
    }
  },
  components: {
    NavBar
  },
  created() {
    this.menu = this.$route.query.menu;
    this.typeId = parseInt(this.$route.query.type);
    this.getNotification();
  },
  methods: {
    getNotification() {
      return axios.get('/common/getUnreadMessage', {
        params: {menu: this.menu},
        headers: {isShowFullLoading: 'F'}
      }).then(res => {
        this.message = [...res.result];
      })
    }
  }
}
</script>

<style scoped>

</style>
